<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/ItemPage">
    <head>        
        <link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
        <link rel="publisher" href="http://google.com/+RentpadPhi" />          
        <meta name="viewport" content="width=device-width, initial-scale=1"> 
        
        <c:choose>
            <c:when test="${model.place.placeTypeID == 5}">
                <title>${model.place.title} - Condos / Apartments For Rent in ${model.place.displayCity}</title>
                <c:if test="${empty model.place.shortDescription}"><meta name="description" content="About ${model.place.title} and list of condos and apartments available for rent." /></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta name="description" content="${model.place.shortDescription}" /></c:if>

                <meta name="keywords" content="${model.place.title} for rent, ${model.place.title} ${model.place.displayCity} for rent, ${model.place.title} apartment for rent, ${model.place.title} condo for rent, ${model.place.title} condominium for rent, apartment for rent at ${model.place.title}, condo for rent at ${model.place.title}, condominium for rent at ${model.place.title}"/>

                <meta property="og:type" content="place"/>
                <meta property="og:site_name" content="Rentpad.com.ph"/>
                <meta property="og:url" content="${model.props.appPath}/places/${fn:replace(model.place.title, ' ', '-')}/${model.place.id}"/>
                <meta property="og:title" content="${model.place.title} - Condos / Apartments For Rent in ${model.place.displayCity}"/>                        
                <c:if test="${empty model.place.shortDescription}"><meta property="og:description" content="About ${model.place.title} and list of condos and apartments available for rent." /></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta property="og:description" content="${model.place.shortDescription}" /></c:if>
                <c:if test="${empty model.place.primaryPhoto.filename}"><meta property="og:image" content="${model.props.appPath}/img/rentpad-logo-1.png"/></c:if>  
                <c:if test="${not empty model.place.primaryPhoto.filename}"><meta property="og:image" content="${model.props.rootPath}/uploads/img/001-${model.place.primaryPhoto.filename}"/></c:if>    


                <meta name="twitter:card" content="summary"/>
                <meta name="twitter:site" value="@rentpadph"/>
                <meta name="twitter:url" content="${model.props.appPath}/places/${fn:replace(place.title, ' ', '-')}/${model.place.id}"/>
                <meta name="twitter:title" content="${model.place.title} - Condos / Apartments For Rent in ${model.place.displayCity}"/>
                <c:if test="${empty model.place.shortDescription}"><meta name="twitter:description" content="About ${model.place.title} and list of condos and apartments available for rent."/></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta name="twitter:description" content="${model.place.shortDescription}"/></c:if>
                <c:if test="${empty model.place.primaryPhoto.filename}"><meta property="twitter:image" content="${model.props.appPath}/img/rentpad-logo-1.png"/></c:if>  
                <c:if test="${not empty model.place.primaryPhoto.filename}"><meta property="twitter:image" content="${model.props.rootPath}/uploads/img/001-${model.place.primaryPhoto.filename}"/></c:if>

                <meta itemprop="name" content="${model.place.title}"/>
                <meta itemprop="keywords" content="${model.place.title} for rent, ${model.place.title} ${model.place.displayCity} for rent, ${model.place.title} apartment for rent, ${model.place.title} condo for rent, ${model.place.title} condominium for rent, apartment for rent at ${model.place.title}, condo for rent at ${model.place.title}, condominium for rent at ${model.place.title}" />
                <c:if test="${empty model.place.shortDescription}"><meta itemprop="description" content="List of condos and apartments available for rent at ${model.place.title}, ${model.place.displayCity}."/></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta itemprop="description" content="${model.place.shortDescription}"/></c:if>     
                <c:if test="${empty model.place.primaryPhoto.filename}"><meta property="image" content="${model.props.appPath}/img/rentpad-logo-1.png"/></c:if>  
                <c:if test="${not empty model.place.primaryPhoto.filename}"><meta property="image" content="${model.props.rootPath}/uploads/img/001-${model.place.primaryPhoto.filename}"/></c:if>          
            </c:when>        
                
            <c:when test="${model.place.placeTypeID == 6}">
                <title>${model.place.title} - Houses For Rent in ${model.place.displayCity}</title>
                <c:if test="${empty model.place.shortDescription}"><meta name="keywords" content="${model.place.title} for rent, ${model.place.title} ${model.place.displayCity} for rent, ${model.place.title} house for rent, house for rent at ${model.place.title}, house for rent at ${model.place.title} ${model.place.displayCity}"/></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta name="description" content="${model.place.shortDescription}" /></c:if>

                <meta property="og:type" content="place"/>
                <meta property="og:site_name" content="Rentpad.com.ph"/>
                <meta property="og:url" content="${model.props.appPath}/places/${fn:replace(model.place.title, ' ', '-')}/${model.place.id}"/>
                <meta property="og:title" content="${model.place.title} - Houses For Rent in ${model.place.displayCity}"/>              
                <c:if test="${empty model.place.shortDescription}"><meta property="og:description" content="About ${model.place.title} and list of houses available for rent." /></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta property="og:description" content="${model.place.shortDescription}" /></c:if>               
                <c:if test="${empty model.place.primaryPhoto.filename}"><meta property="og:image" content="${model.props.appPath}/img/rentpad-logo-1.png"/></c:if>  
                <c:if test="${not empty model.place.primaryPhoto.filename}"><meta property="og:image" content="${model.props.rootPath}/uploads/img/001-${model.place.primaryPhoto.filename}"/></c:if> 

                <meta name="twitter:card" content="summary"/>
                <meta name="twitter:site" value="@rentpadph"/>
                <meta name="twitter:url" content="${model.props.appPath}/places/${fn:replace(model.place.title, ' ', '-')}/${model.place.id}"/>
                <meta name="twitter:title" content="${model.place.title} - Houses For Rent in ${model.place.displayCity}"/>
                <c:if test="${empty model.place.shortDescription}"><meta name="twitter:description" content="About ${model.place.title} and list of houses available for rent."/></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta name="twitter:description" content="${model.place.shortDescription}"/></c:if>            
                <c:if test="${empty model.place.primaryPhoto.filename}"><meta property="twitter:image" content="${model.props.appPath}/img/rentpad-logo-1.png"/></c:if>  
                <c:if test="${not empty model.place.primaryPhoto.filename}"><meta property="twitter:image" content="${model.props.rootPath}/uploads/img/001-${model.place.primaryPhoto.filename}"/></c:if>

                <meta itemprop="name" content="${model.place.title}"/>
                <meta itemprop="keywords" content="${model.place.title} for rent, ${model.place.title} ${model.place.displayCity} for rent, ${model.place.title} apartment for rent, ${model.place.title} condo for rent, ${model.place.title} condominium for rent, apartment for rent at ${model.place.title}, condo for rent at ${model.place.title}, condominium for rent at ${model.place.title}" />
                <c:if test="${empty model.place.shortDescription}"><meta itemprop="description" content="List of houses available for rent at ${model.place.title}, ${model.place.displayCity}."/></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta itemprop="description" content="${model.place.shortDescription}"/></c:if>            
                <c:if test="${empty model.place.primaryPhoto.filename}"><meta property="image" content="${model.props.appPath}/img/rentpad-logo-1.png"/></c:if>  
                <c:if test="${not empty model.place.primaryPhoto.filename}"><meta property="image" content="${model.props.rootPath}/uploads/img/001-${model.place.primaryPhoto.filename}"/></c:if>
            </c:when>
                
            <c:otherwise>
                <title>${model.place.title} - Homes For Rent in ${model.place.displayCity}</title>
                <c:if test="${empty model.place.shortDescription}"><meta name="keywords" content="${model.place.title} for rent, ${model.place.title} ${model.place.displayCity} for rent, ${model.place.title} house for rent, house for rent at ${model.place.title}, house for rent at ${model.place.title} ${model.place.displayCity}"/></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta name="description" content="${model.place.shortDescription}" /></c:if>

                <meta property="og:type" content="place"/>
                <meta property="og:site_name" content="Rentpad.com.ph"/>
                <meta property="og:url" content="${model.props.appPath}/places/${fn:replace(model.place.title, ' ', '-')}/${model.place.id}"/>
                <meta property="og:title" content="${model.place.title} - Homes For Rent in ${model.place.displayCity}"/>              
                <c:if test="${empty model.place.shortDescription}"><meta property="og:description" content="About ${model.place.title} and list of properties available for rent." /></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta property="og:description" content="${model.place.shortDescription}" /></c:if>               
                <c:if test="${empty model.place.primaryPhoto.filename}"><meta property="og:image" content="${model.props.appPath}/img/rentpad-logo-1.png"/></c:if>  
                <c:if test="${not empty model.place.primaryPhoto.filename}"><meta property="og:image" content="${model.props.rootPath}/uploads/img/001-${model.place.primaryPhoto.filename}"/></c:if> 

                <meta name="twitter:card" content="summary"/>
                <meta name="twitter:site" value="@rentpadph"/>
                <meta name="twitter:url" content="${model.props.appPath}/places/${fn:replace(model.place.title, ' ', '-')}/${model.place.id}"/>
                <meta name="twitter:title" content="${model.place.title} - Homes For Rent in ${model.place.displayCity}"/>
                <c:if test="${empty model.place.shortDescription}"><meta name="twitter:description" content="About ${model.place.title} and list of homes available for rent."/></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta name="twitter:description" content="${model.place.shortDescription}"/></c:if>            
                <c:if test="${empty model.place.primaryPhoto.filename}"><meta property="twitter:image" content="${model.props.appPath}/img/rentpad-logo-1.png"/></c:if>  
                <c:if test="${not empty model.place.primaryPhoto.filename}"><meta property="twitter:image" content="${model.props.rootPath}/uploads/img/001-${model.place.primaryPhoto.filename}"/></c:if>

                <meta itemprop="name" content="${model.place.title}"/>
                <meta itemprop="keywords" content="${model.place.title} for rent, ${model.place.title} ${model.place.displayCity} for rent, ${model.place.title} apartment for rent, ${model.place.title} condo for rent, ${model.place.title} condominium for rent, apartment for rent at ${model.place.title}, condo for rent at ${model.place.title}, condominium for rent at ${model.place.title}" />
                <c:if test="${empty model.place.shortDescription}"><meta itemprop="description" content="List of homes available for rent at ${model.place.title}, ${model.place.displayCity}."/></c:if>
                <c:if test="${not empty model.place.shortDescription}"><meta itemprop="description" content="${model.place.shortDescription}"/></c:if>            
                <c:if test="${empty model.place.primaryPhoto.filename}"><meta property="image" content="${model.props.appPath}/img/rentpad-logo-1.png"/></c:if>  
                <c:if test="${not empty model.place.primaryPhoto.filename}"><meta property="image" content="${model.props.rootPath}/uploads/img/001-${model.place.primaryPhoto.filename}"/></c:if>
            </c:otherwise>
                
        </c:choose>
        
        <link rel="stylesheet" href="${model.props.appPath}/css/jquery_mobile/jquery.mobile-1.2.1.min.css" type="text/css"/>        
        <style>
            a {color:#404042;text-decoration:none;}      /* unvisited link */
        </style>

        <script type="text/javascript" src="${model.props.appPath}/js/jquery/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="${model.props.appPath}/js/jquery_mobile/jquery.mobile-1.2.1.min.js"></script>

        <%@ include file="include/listingedit_mobile_incl.jsp" %> 

        <link rel="stylesheet" href="css/bootstrap/prettify.css" rel="stylesheet">
        <link rel="stylesheet" href="css/bootstrap/index.css" rel="stylesheet">

        <script src="js/bootstrap/bootstrap.min.js"></script>
        <script src="js/bootstrap/bootstrap-wysiwyg.js"></script>
        <script src="js/bootstrap/jquery.hotkeys.js"></script>

        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>
        <%@ include file="include/placeMaps_mobile.jsp" %>

        <script type="text/javascript">
            $(function() {
                try {
                }
                catch (e) {
                    alert(e)
                }
            });
        </script> 

        <script>
            $(document).ready(function() {
                //alert('ready!');
                $("#place-shortTermRentals").hide();
                initialize();
            });
            function switchMenu() {
                if ($('#menu').is(':visible')) {
                    $("#menu").hide();
                }
                else {
                    $("#menu").show();
                }
            }
            function switchTab1() {          
                $("#place-longTermRentals").show();
                $("#place-shortTermRentals").hide();      
            }
            function switchTab2() {
                $("#place-longTermRentals").hide();
                $("#place-shortTermRentals").show();
            }
        </script>

        <script>
            (function(i, s, o, g, r, a, m) {
                i['GoogleAnalyticsObject'] = r;
                i[r] = i[r] || function() {
                    (i[r].q = i[r].q || []).push(arguments)
                }, i[r].l = 1 * new Date();
                a = s.createElement(o),
                        m = s.getElementsByTagName(o)[0];
                a.async = 1;
                a.src = g;
                m.parentNode.insertBefore(a, m)
            })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
            ga('create', 'UA-44197833-1', 'rentpad.com.ph');
            ga('send', 'pageview');
        </script>

    </head>

    <body>
        <div data-role="page" data-theme="d">

            <%@include file="header_mobile.jsp" %>

            <c:if test="${model.place.placeTypeID == 1}">
                <div itemscope itemtype="http://schema.org/Place" itemprop="contentLocation" data-role="header" data-theme="c">
            </c:if>
            <c:if test="${model.place.placeTypeID == 2}">
                <div itemscope itemtype="http://schema.org/Place" itemprop="contentLocation" data-role="header" data-theme="c">
            </c:if>
            <c:if test="${model.place.placeTypeID == 3}">
                <div itemscope itemtype="http://schema.org/Place" itemprop="contentLocation" data-role="header" data-theme="c">
            </c:if>
            <c:if test="${model.place.placeTypeID == 4}">
                <div itemscope itemtype="http://schema.org/Place" itemprop="contentLocation" data-role="header" data-theme="c">
            </c:if>
            <c:if test="${model.place.placeTypeID == 5}">
                <div itemscope itemtype="http://schema.org/ApartmentComplex" itemprop="contentLocation" data-role="header" data-theme="c">                                                
            </c:if>             
            <c:if test="${model.place.placeTypeID == 6}">
                <div itemscope itemtype="http://schema.org/GatedResidenceCommunity" itemprop="contentLocation" data-role="header" data-theme="c">                                                
            </c:if>  
                
                <p style="color: #666666; font-size: 16px; text-align: center;"><span itemprop="name">${model.place.title}</span></p>   
                
                <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress" style="color: #666666; font-size: 12px; text-align: center; position: relative; top: -10px;">                    
                    <c:if test="${not empty model.place.street}"><span itemprop="streetAddress">${model.place.street}, </span></c:if>
                    <c:if test="${not empty model.place.displayCity}"><span itemprop="streetAddress">${model.place.displayCity} </span></c:if>
                    <c:if test="${not empty model.place.region}"><span itemprop="streetAddress" style="display: none;">${model.place.region}</span></c:if>
                    <c:if test="${not empty model.place.country}"><span itemprop="streetAddress" style="display: none;">${model.place.country}</span></c:if>                    
                </div>    
                
                <div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
                    <meta itemprop="latitude" content="${model.place.lat}" />
                    <meta itemprop="longitude" content="${model.place.lng}" />
                </div>

                <c:if test="${not empty model.place.wikiURL}">
                    <meta itemprop="sameAs" content="${model.place.wikiURL}"/>  
                </c:if>
                <meta itemprop="url" content="${model.props.appPath}/places/${fn:replace(fn:toLowerCase(place.title), ' ', '-')}/${model.place.id}"/> 

                                                
            </div>

                <div id="map_canvas" style="width: 100%; height:150px; position:relative; left:0%">
                    
                </div>    

                <div data-role="navbar" style="width: 100%;" data-theme="a">
                    <ul>
                        <li><a href="#" class="ui-btn-active ui-state-persist" data-theme="a" onclick="switchTab1()">Long Term Rentals</a></li>
                        <li><a href="#" data-theme="a" onclick="switchTab2()">Short Term Rentals</a></li>
                    </ul>
                </div>

                <div id="place-longTermRentals">

                    <ul data-role="listview" data-theme="d">                       
                    <c:forEach items="${model.longTermListings}" var="listing">
                        <li itemprop="offers" itemscope itemtype="http://schema.org/Offer" style="height: 90px;">
                            <c:choose>
                                <c:when test="${listing.leaseShortTerm}">
                                    <a href="${model.props.appPath}/short-term-rentals/${fn:toLowerCase(listing.city)}/${fn:replace(listing.displayTitle, ' ', '-')}/${listing.id}" title="${listing.title} for rent in ${listing.city}" data-ajax="false">
                                    </c:when>
                                    <c:otherwise>
                                        <a href="${model.props.appPath}/long-term-rentals/${fn:toLowerCase(listing.city)}/${fn:replace(listing.displayTitle, ' ', '-')}/${listing.id}" title="${listing.title} for rent in ${listing.city}" data-ajax="false">
                                        </c:otherwise>
                                    </c:choose>

                                    <img itemprop="image" src="${model.props.rootPath}/uploads/img/002-${listing.primaryPhoto.filename}" style="min-height: 90px; min-width: 120px;"/>
                                    <p itemprop="itemOffered" itemscope itemtype="http://schema.org/Product" style="display: block; text-align: left; padding-bottom: 2px; margin-left: 30px; font-size: 14px"><b itemprop="name">${listing.title}</b></p>

                                    <p style="text-align: left; margin-left: 30px;">
                                        <meta itemprop="priceCurrency" content="PHP" />
                                        <span itemprop="price">&#8369; ${listing.longMonthRate}</span>
                                         / Month
                                    </p>
                                    

                                    <c:if test="${listing.community != null}">
                                        <p style="text-align: left; margin-left: 30px;">${listing.community.title}</p>
                                        <p style="text-align: left; margin-left: 30px; color: #339900;">${listing.city}</p>  
                                    </c:if>   

                                    <c:if test="${listing.community == null}">
                                        <p style="text-align: left; margin-left: 30px; color: #339900;">${listing.city}</p>
                                    </c:if>

                                </a>
                        </li>
                    </c:forEach>
                        <li>
                            <c:choose>
                                <c:when test="${model.place.placeTypeID != 5 && model.place.placeTypeID != 6}">
                                    <a href="${model.props.appPath}/long-term-rentals/${fn:replace(fn:toLowerCase(model.place.title), ' ', '-')}" style="color:#369;" data-ajax="false">See more long terms in ${model.place.title}</a>
                                </c:when>
                                <c:otherwise>
                                    <a href="${model.props.appPath}/long-term-rentals/${fn:replace(fn:toLowerCase(model.place.displayCity), ' ', '-')}" style="color:#369;" data-ajax="false">See more long terms in ${model.place.displayCity}</a>
                                </c:otherwise>
                            </c:choose>    
                        </li>
                </ul>
            </div>

            <div id="place-shortTermRentals">
                <ul data-role="listview" data-theme="d">                       
                    <c:forEach items="${model.shortTermListings}" var="listing">
                        <li itemprop="offers" itemscope itemtype="http://schema.org/Offer" style="height: 90px;">
                            <c:choose>
                                <c:when test="${listing.leaseShortTerm}">
                                    <a href="${model.props.appPath}/short-term-rentals/${fn:toLowerCase(listing.city)}/${fn:replace(listing.displayTitle, ' ', '-')}/${listing.id}" title="${listing.title} for rent in ${listing.city}" data-ajax="false">
                                    </c:when>
                                    <c:otherwise>
                                        <a href="${model.props.appPath}/long-term-rentals/${fn:toLowerCase(listing.city)}/${fn:replace(listing.displayTitle, ' ', '-')}/${listing.id}" title="${listing.title} for rent in ${listing.city}" data-ajax="false">
                                        </c:otherwise>
                                    </c:choose>

                                    <img itemprop="image" src="${model.props.rootPath}/uploads/img/002-${listing.primaryPhoto.filename}" style="min-height: 90px; min-width: 120px;"/>
                                    <p itemprop="itemOffered" itemscope itemtype="http://schema.org/Product" style="display: block; text-align: left; padding-bottom: 2px; margin-left: 30px; font-size: 14px"><b itemprop="name">${listing.title}</b></p>
                                                                       
                                    <p style="text-align: left; margin-left: 30px;">
                                        <meta itemprop="priceCurrency" content="PHP" />
                                        <span itemprop="price">&#8369; ${listing.shortDayRate}</span>
                                         / Night
                                    </p>
                                    
                                    <c:if test="${listing.community != null}">
                                        <p style="text-align: left; margin-left: 30px;">${listing.community.title}</p>
                                        <p style="text-align: left; margin-left: 30px; color: #339900;">${listing.city}</p>  
                                    </c:if>   

                                    <c:if test="${listing.community == null}">
                                        <p style="text-align: left; margin-left: 30px; color: #339900;">${listing.city}</p>
                                    </c:if>

                                </a>
                        </li>
                    </c:forEach>
                        <li>
                            <c:choose>
                                <c:when test="${model.place.placeTypeID != 5 && model.place.placeTypeID != 6}">
                                    <a href="${model.props.appPath}/short-term-rentals/${fn:replace(fn:toLowerCase(model.place.title), ' ', '-')}" style="color:#369;" data-ajax="false">See more short terms in ${model.place.title}</a>
                                </c:when>
                                <c:otherwise>
                                    <a href="${model.props.appPath}/short-term-rentals/${fn:replace(fn:toLowerCase(model.place.displayCity), ' ', '-')}" style="color:#369;" data-ajax="false">See more short terms in ${model.place.displayCity}</a>
                                </c:otherwise>
                            </c:choose> 
                        </li>
                </ul>
            </div>
            <c:if test="${fn:length(model.foursqTips) > 0}">
                <div data-role="header" data-theme="c">
                    <img src="${model.props.appPath}/img/4sq-powered-by.png" style="height: 100%; width:97%; padding: 5px;" onclick="window.location='http://foursquare.com/v/${model.place.foursqVenueID}?ref=ML2DEUK5TVCJIAXQR23ABT1VYGMHPJZOAKDH31HY4USHGYIM'" title="Reviews and Tips by Foursquare" alt="Reviews and Tips by Foursquare"/>
                        
                </div>
                <div id="place-reviews">
                    <ul data-role="listview" data-theme="d">                       
                        <c:forEach items="${model.foursqTips}" var="foursqTip">
                            <li style="">
                                <table cellpadding="5" cellspacing="5" width: 100%;">
                                    <tr>
                                        <td style="width: 36px; vertical-align: top;"><img src="${foursqTip.photoPrefix}37x37${foursqTip.photoSufix}" /></td>
                                        <td style="vertical-align: top;">
                                            <span style="font-size: 14px; font-weight: normal;">${foursqTip.text}</span><br>
                                            <span style="font-size: 13px; color: #369;">${foursqTip.firstName} ${foursqTip.lastName}</span>
                                        </td>
                                    </tr>
                                </table>  
                            </li>
                        </c:forEach>
                    </ul>
                </div>
            </c:if>
                
            <div data-role="footer">
                <%@include file="footer_mobile.jsp" %>      
            </div>

            
            
        </div>
    </body>
</html>
